class CreateFotsAndFings < ActiveRecord::Migration
  def self.up
    create_table :fots, :force => true do |t|
     t.string   :name,      :default => "",    :limit => 255, :null => false
     t.text     :content,   :default => "",    :null => false
     t.boolean  :public,    :default => false, :null => false
     t.integer  :friend_id, :null => false
     t.datetime :created_at
     t.datetime :updated_at
    end    

    add_index :fots, ["friend_id"], :name => "fk_fots_friend"

    create_table :fings, :force => true do |t|
     t.string   :name,      :default => "",    :limit => 255, :null => false
     t.text     :content,   :default => "",    :null => false
     t.boolean  :public,    :default => false, :null => false
     t.integer  :fot_id,    :null => false
     t.datetime :created_at
     t.datetime :updated_at
    end

    add_index :fings, ["fot_id"], :name => "fk_fots_fings"

  end

  def self.down
    drop_table :fots
    drop_table :fings
  end
end